package cn.zcq100.xmlParse;

import java.io.*;
import java.net.*;
import javax.xml.xpath.*;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class Rss {

	public static void main(String[] args) throws MalformedURLException {
		try {
			//URL url=new URL("http://www.androidin.net/bbs/rss.php?fid=62&auth=f374Zw%2FHwmijvhH1kJe98vgWtyKST78WW054b40xy8Bga7BoM2mHek6KEAjQSw");
//			URL url=new URL("http://www.javaeye.com/rss/forum");
//			URL url=new URL("d:\\my.xml");
			
//			InputStream is=url.openStream();
			InputStream is=new FileInputStream("d:\\my.xml");
			XPath xpath=XPathFactory.newInstance().newXPath();
			InputSource source=new InputSource(is);
			NodeList nodes=(NodeList)xpath.evaluate("//ReadComm", source,XPathConstants.NODESET);
			for (int i = 0; i < nodes.getLength(); i++) {
				System.out.println(nodes.item(i).getTextContent());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
